<?php

namespace api\models;

use Yii;

/**
 * This is the model class for table "user_info".
 *
 * @property integer $user_id
 * @property string $area_id
 * @property string $tags
 * @property string $name
 * @property string $city
 * @property string $district
 * @property string $streets
 * @property string $grid_center
 * @property string $department
 * @property string $avatar
 * @property string $category
 * @property string $handle_event_types
 * @property string $created_at
 * @property string $handle_channels
 * @property string $identity
 */
class UserInfo extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'user_info';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('test2');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'name', 'created_at'], 'required'],
            [['user_id'], 'integer'],
            [['created_at'], 'safe'],
            [['area_id'], 'string', 'max' => 50],
            [['tags'], 'string', 'max' => 500],
            [['name', 'city', 'district', 'streets', 'department', 'avatar', 'category', 'handle_event_types', 'handle_channels', 'identity'], 'string', 'max' => 255],
            [['grid_center'], 'string', 'max' => 2056],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'user_id' => 'User ID',
            'area_id' => 'Area ID',
            'tags' => 'Tags',
            'name' => 'Name',
            'city' => 'City',
            'district' => 'District',
            'streets' => 'Streets',
            'grid_center' => 'Grid Center',
            'department' => 'Department',
            'avatar' => 'Avatar',
            'category' => 'Category',
            'handle_event_types' => 'Handle Event Types',
            'created_at' => 'Created At',
            'handle_channels' => 'Handle Channels',
            'identity' => 'Identity',
        ];
    }
}
